/*
 *  Copyright 2001-2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package ar.uba.fi.posgrado.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ar.uba.fi.posgrado.common.model.AbstractDomainObject;
import ar.uba.fi.posgrado.common.model.Student;

/**
 * Cursada
 * 
 * @author ariel.piechotka
 * 
 */

@Entity
@Table(name = "CURSADA")
@SuppressWarnings("serial")
public class Coursing extends AbstractDomainObject {

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_ALUMNO", nullable = false)
	private Student student;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_ACTA")
	private AcademicRecord academicRecord;

	@Column(name = "CALIFICACION")
	private byte mark;

	public AcademicRecord getAcademicRecord() {
		return academicRecord;
	}

	public void setAcademicRecord(AcademicRecord academicRecord) {
		this.academicRecord = academicRecord;
	}

	public byte getMark() {
		return mark;
	}

	public void setMark(byte mark) {
		this.mark = mark;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@Override
	public String[] getExcludedFields() {
		return new String[] { "student", "academicRecord", "mark" };
	}
}
